package com.sky.cqculture.pojo;

import java.util.Date;
import java.util.List;

public class Order {
    private Integer id;          // 订单ID
    private Integer userId;      // 用户ID
    private Double totalPrice;   // 订单总价
    private String status;       // 订单状态 (例如：待付款、已付款、已发货、已完成等)
    private Date createTime;     // 订单创建时间
    private Date updateTime;     // 订单更新时间
    
    // 扩展字段
    private User user;           // 用户信息
    private List<OrderItem> orderItems; // 订单项列表
    
    // 构造方法
    public Order() {}
    
    public Order(Integer userId, Double totalPrice) {
        this.userId = userId;
        this.totalPrice = totalPrice;
        this.status = "待付款";
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Order(Integer id, Integer userId, Double totalPrice, String status, Date createTime, Date updateTime, User user, List<OrderItem> orderItems) {
        this.id = id;
        this.userId = userId;
        this.totalPrice = totalPrice;
        this.status = status;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.user = user;
        this.orderItems = orderItems;
    }

    // getter和setter方法
    public Integer getId() { return id; }
    public void setId(Integer id) { this.id = id; }
    
    public Integer getUserId() { return userId; }
    public void setUserId(Integer userId) { this.userId = userId; }
    
    public Double getTotalPrice() { return totalPrice; }
    public void setTotalPrice(Double totalPrice) { this.totalPrice = totalPrice; }
    
    public String getStatus() { return status; }
    public void setStatus(String status) { this.status = status; }
    
    public Date getCreateTime() { return createTime; }
    public void setCreateTime(Date createTime) { this.createTime = createTime; }
    
    public User getUser() { return user; }
    public void setUser(User user) { this.user = user; }
    
    public List<OrderItem> getOrderItems() { return orderItems; }
    public void setOrderItems(List<OrderItem> orderItems) { this.orderItems = orderItems; }
}